#!/bin/sh
echo "set channel " $1
echo "set antenna" $2
echo "set bandwidth" $3
echo "set MCS" $4
echo "set txpower dbm" $5

/DHD/wl -i eth5 down
/DHD/wl -i eth5 mpc 0
/DHD/wl -i eth5 country ALL
/DHD/wl -i eth5 mimo_bw_cap 1
/DHD/wl -i eth5 phy_watchdog 0
/DHD/wl -i eth5 stbc_tx 0
/DHD/wl -i eth5 stbc_rx 0
/DHD/wl -i eth5 tempsense_disable 1
/DHD/wl -i eth5 up
/DHD/wl -i eth5 ap 0
/DHD/wl -i eth5 interference 0
/DHD/wl -i eth5 interference_override 0
/DHD/wl -i eth5 rtsthresh 1714
/DHD/wl -i eth5 phy_percal
/DHD/wl -i eth5 glacial_timer 15000
/DHD/wl -i eth5 fast_timer 15000
/DHD/wl -i eth5 slow_timer 15000
/DHD/wl -i eth5 scansuppress 0
/DHD/wl -i eth5 phy_scraminit 127
/DHD/wl -i eth5 pkteng_stop tx
/DHD/wl -i eth5 pkteng_stop rx
/DHD/wl -i eth5 down
/DHD/wl -i eth5 band a
/DHD/wl -i eth5 rxchain $2
/DHD/wl -i eth5 txchain $2
/DHD/wl -i eth5 txcore -s 1 -c $2 -o $2 -k $2
/DHD/wl -i eth5 up
/DHD/wl -i eth5 down
/DHD/wl -i eth5 mpc 0
if [ $3 -eq 40 ] ; then
      echo "40 width"
      /DHD/wl -i eth5 chanspec $1/40u
else
      /DHD/wl -i eth5 chanspec $1/$3
fi
/DHD/wl -i eth5 phy_tx_tone 0
/DHD/wl -i eth5 up
/DHD/wl -i eth5 isup
/DHD/wl -i eth5 txpwr1 -o -d $5
#./wl -i eth5 5g_rate -h 7 -b 20
/DHD/wl -i eth5 5g_rate -v $4 -x 0 -b $3
/DHD/wl -i eth5 phy_forcecal 1
/DHD/wl -i eth5 phy_activecal 
/DHD/wl -i eth5 pkteng_start 80:af:f0:10:00:01 tx 50 1472 0
sleep 1
#./wl phy_tx_tone 1
